package com.example.myapplication

import android.util.Log
import com.wakeup.sdk.ble.ext.order.BleOrderAnalyzer
import com.wakeup.sdk.ble.utils.BleUtil
import com.wakeup.sdk.ble.utils.toHexStr

/**
 * @Author:      lsr
 * @CreateDate:  2024/2/19 10:17
 * @Description: 类功能描述说明
 */
class CustomAnalyzer : BleOrderAnalyzer {
    private val TAG = "CustomAnalyzer"
    override fun analyzeOrder(mac: String, bytes: ByteArray, datas: MutableList<Int>) {
        if (datas.size < 6) return
        if (datas[0] != 0xFF) return
        val id = datas[4]
        val bsId = datas[5]
        if (id == 0xFF || bsId == 0x01) {
            Log.i(TAG, "analyzeOrder: ${bytes.toHexStr()}")
        }
    }
}